<include file="Publics/head"/>


<body class="no-skin">
<include file="Publics/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Publics/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Publics/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Publics/set"/>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <form class="form-horizontal"  id="form" action="{:U('')}" method="post">
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 收件人 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="name" id="name" class="rcol-xs-10 col-sm-5" value="">
	                                    <span class="help-inline col-xs-12 col-sm-7">
											<span class="middle"></span>
										</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 标题 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="title" id="title" class="rcol-xs-10 col-sm-5" value="">
	                                    <span class="help-inline col-xs-12 col-sm-7">
											<span class="middle"></span>
										</span>
                                </div>
                            </div>

                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 邮件内容</label>
                                <div class="col-sm-9">
                                    <textarea name="tips" id="tips" placeholder="页面提示" class="col-xs-10 col-sm-5"
                                              rows="5">{$currentmenu.tips}</textarea>
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle"></span>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>
                            <div class="col-md-offset-2 col-md-9">
                                <button class="btn btn-info submit" type="button">
                                    <i class="icon-ok bigger-110"></i>
                                    提交
                                </button>

                                &nbsp; &nbsp; &nbsp;
                                <button class="btn" type="reset">
                                    <i class="icon-undo bigger-110"></i>
                                    重置
                                </button>
                            </div>
                        </form>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Publics/footer"/>

</div><!-- /.main-container -->

<include file="Publics/footerjs"/>
<!-- inline scripts related to this page -->

<!-- icon选择插件begin -->
    <script src="/Public/icon_select/jquery.fonticonpicker.js"></script>
    <link href="/Public/icon_select/css/jquery.fonticonpicker.css" rel="stylesheet" />
    <link href="/Public/icon_select/themes/grey-theme/jquery.fonticonpicker.grey.css" rel="stylesheet" />
    <link href="/Public/icon_select/themes/dark-grey-theme/jquery.fonticonpicker.darkgrey.css" rel="stylesheet" />
    <link href="/Public/icon_select/themes/bootstrap-theme/jquery.fonticonpicker.bootstrap.css" rel="stylesheet" />
    <link href="/Public/icon_select/themes/inverted-theme/jquery.fonticonpicker.inverted.css" rel="stylesheet" />
    <link href="/Public/icon_select/fontello-7275ca86/css/fontello.css" rel="stylesheet" />
<!-- icon选择插件end -->

<script type="text/javascript">
    $(function () {
    	var editor = KindEditor.create('textarea[name="tips"]', {
            resizeType: 1,
            allowPreviewEmoticons: false,
            allowImageUpload: false,
            items: [
                'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
                'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
                'insertunorderedlist', '|', 'emoticons', 'link']
        });	
        
        $(".submit").click(function () {
        	var jsonData = {
        		'title' : $("#title").val(),
        		'name' : $("#name").val(),
        		'tips' : editor.html(),
        	}
        	console.log(jsonData)
        	$.ajax({
    			type: "post",
    			url: "{:U('Other/sendEmail')}",
    			dataType: 'JSON',
    			data: jsonData,
    			error: function () {
    				return false;
    			},
    			success: function (data) {
    				bootbox.alert({  
                        buttons: {  
                           ok: {label: '确定',className: 'btn-danger'}  
                        },  
                        message: data,  
                        callback: function() {  
                          	//location.reload(); 
                        },  
                        title: "系统提示",  
                    });
    			}
    		});
        	
        })

    })
</script>

</body>
</html>
